function ModifierViewer(){
	this.modifierViewer = document.getElementById('modifier_viewer');
	// this.modifier = document.getElementById("modifier");
}

ModifierViewer.prototype.addObject = function(name){
	this.clean();
	this.addItem(name);
	// this.modifier.addEventListener('click', function(){
	// 	propertyPanel.update();
	// });
}

// ModifierViewer.prototype.addItem = function(name,id){
// 	var item = document.createElement('div');
// 	item.innerHTML = name;

// 	item.id= id + "m";
	
// 	this.modifierViewer.appendChild(item);
// }

ModifierViewer.prototype.addItem = function(name){
	var item = document.createElement('div');
	item.innerHTML = name;
	// item.id= id + "m";
	
	this.modifierViewer.appendChild(item);
	item.addEventListener("click", function(evt){
		;
	});
}

ModifierViewer.prototype.clean = function(){
	// console.log(this.modifierViewer.childNodes.length);
	// console.log(this.modifierViewer.childNodes);
	for(var i = this.modifierViewer.childNodes.length-1;i >= 0;i--){
		this.modifierViewer.removeChild(this.modifierViewer.childNodes[i]);
	}
}

ModifierViewer.prototype.update = function(){
	// console.log(this.modifierViewer.childNodes);
	if(activeObject.modifier == null){
		this.addObject(activeObject.name);
	}
	
	if(activeObject.modifier != null && activeObject.modifier != undefined){
		this.clean();
		// console.log('已经就绪哈哈哈');
		// console.log(activeObject.modifier.nameStack);
		for (var i = activeObject.modifier.nameStack.length - 1; i >= 0; i--) {
			this.addItem(activeObject.modifier.nameStack[i]);
			// console.log('有料');
		}
		this.addItem(activeObject.name);
	}
	
}